/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qdu.servlet;

import com.qdu.dao.ManageActiDao;
import com.qdu.entity.Activity;
import com.qdu.service.ActivityService;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 管理首页
 *实现获得所有activity列表，在首页的
 * @author 19645
 */
@WebServlet("/ModifyActiv")
public class ModifyActiServlet extends HttpServlet{
    ManageActiDao manage=new ManageActiDao();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        
        //获得参数
        String activityId=req.getParameter("MactivityId");
        String aname=req.getParameter("Maname");
        String arank=req.getParameter("Marank");
        //转换成int型
        int anumber=2;
        anumber=Integer.parseInt(req.getParameter("Manumber"));
        
        String astatus=req.getParameter("Mastatus");
        String adeadline=req.getParameter("Madeadline");
        String astartTime=req.getParameter("MastartTime");
        String aendTime=req.getParameter("MaendTime");
        String aaddress=req.getParameter("Maaddress");
        String atransport=req.getParameter("Matransport");
        String atype=req.getParameter("Matype");
        String anote=req.getParameter("Manote");
        String auserId=req.getParameter("MauserId");
        
       Activity activity = new Activity(auserId,atype,aname,arank,anumber,adeadline,astartTime,aendTime,astatus,aaddress,atransport,anote);
        
        int row = manage.ModifyActivity(activity, activityId);
        resp.sendRedirect("ManagerActiv");
        System.out.println("输出row");
        System.out.println(""+row);
        
    }
    
}
